/*
 * Created on Apr 10, 2007
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 * 
 * Copyright @2007 the original author or authors.
 */
package org.testng.abbot.fixture;

import java.awt.Component;

/**
 * Understands simulation of user events and state verification of a <code>{@link Component}</code> that displays text.
 * @param <T> the type of component handled by this fixture. 
 *
 * @author Alex Ruiz
 */
public interface TextDisplayFixture<T extends Component> extends ComponentFixture<T> {

  /** @return the text of the target component. */
  String text();

  /**
   * Asserts that the text of the target component is equal to the given one. 
   * @param expected the text to match.
   * @return this fixture.
   * @throws AssertionError if the text of the target component is not equal to the given one.
   */
  TextDisplayFixture<T> shouldHaveThisText(String expected);

}
